#include<iostream>
#include<string>
using namespace std;
string s;
int main()
{
	cin >> s;
	int ans = 0;
	int k = 1;
	for (int i = 0; i < s.size() - 1; i++) {
		if (s[i] >= '0' && s[i] <= '9') {
			ans += (s[i] - '0') * k;
			k++;
		}
	}
	//cout<<"ans=="<<ans<<endl;
	ans %= 11;
	if (ans == 10 && s[s.size() - 1] == 'X') {
		cout << "Right" << endl;
		return 0;
	}
	if (s[s.size() - 1] - '0' == ans) {
		cout << "Right" << endl;
	}
	else {
		for (int i = 0; i < s.size() - 1; i++) {
			cout << s[i];
		}
		//cout << ans << endl;
		if (ans == 10) {
			cout << "X" << endl;
		}
		else {
			cout << ans << endl;
		}
	}
	return 0;
}